package com.dz.controller.admin;

import com.dz.result.Result;
import com.dz.service.ShopService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 鄧浩奇
 * @classname ShopController
 * @description
 * @since 2024/1/4 19:36
 **/


@Api(tags = "管理端店铺操作接口")
@RestController("adminShopController")
@RequestMapping("/admin/shop")
public class ShopController {

    private final ShopService shopService;

    @Autowired
    public ShopController(ShopService shopService) {
        this.shopService = shopService;
    }

    @ApiOperation("修改店铺营业还是打样")
    @PutMapping("{status}")
    public Result<String> shopStatus(@PathVariable Integer status) {
        //        HttpClientUtil.doPost("http://localhost:8080/user/shop/status", null);
        return shopService.shopStatus(status);
    }

    @ApiOperation("获取营业状态")
    @GetMapping("/status")
    public Result<Integer> getShopStatus() {
        return shopService.getShopStatus();
    }

}
